package com.smedi.ismedi.dangeroussourcemanage.api.dto.request;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.smedi.ismedi.authority.starter.request.ValidGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.time.LocalDateTime;

/**
 * 添加和编辑危险源请求
 *
 * @author xienannan
 * @date 2021/08/23
 */
@Data
@ApiModel(value = "添加和编辑危险源请求")
public class DangerousSourceManageRequest {
    @ApiModelProperty(value = "危险源ID")
    @Null(message = "新增危险源Id应为空", groups = ValidGroup.Add.class)
    @NotNull(message = "编辑危险源ID不能为空", groups = ValidGroup.Edit.class)
    private Long id;

    @ApiModelProperty(value = "危险源库id", required = true)
    private Long libraryId;

    @ApiModelProperty(value = "项目id", required = true)
    private Long projectId;

    @ApiModelProperty(value = "项目名称", required = true)
    private String projectName;

    @ApiModelProperty(value = "施工单位id")
    private Long constructionUnitId;

    @ApiModelProperty(value = "施工单位")
    private String constructionUnit;

    @ApiModelProperty(value = "单位工程")
    private String unitEngineering;

    @ApiModelProperty(value = "重点危险源")
    private String keyHazards;

    @ApiModelProperty(value = "工程地址")
    private String projectAddress;

    @ApiModelProperty(value = "计划施工时间", required = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh", timezone = "GMT+8")
    private LocalDateTime planConstructionTime;

    @ApiModelProperty(value = "计划结束时间", required = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh", timezone = "GMT+8")
    private LocalDateTime planEndTime;
}
